﻿using System;
using System.Diagnostics.Contracts;
using System.IO;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class CompressPicturesRecord : BiffRecord
    {
        private FrtHeader frtHeader;
        private uint fAutoCompressPictures;
        protected override void ReadContent(BiffReaderContext context, int length)
        {
            frtHeader.Read(context.Reader);
            Contract.Assert(frtHeader._rt == 0x89B);
            fAutoCompressPictures = context.ReadUInt32();
        }

        internal override BiffRecordType RecordType
        {
            get { return BiffRecordType.CompressPictures; }
        }


        internal override void WriteContent(BiffWriterWorkbookContext context)
        {
            frtHeader.Write(context);
            Contract.Assert(frtHeader._rt == 0x89B);
            context.Writer.Write(fAutoCompressPictures);
        }
    }
}